import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
class File_01{
  public static void main(String argv[]){
    System.out.println("File Demo");
    File file = new File("./a.txt");
    if(file.exists()){
      try{
        System.out.println("文件存在，写入文件内容");
        FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
        BufferedWriter bw = new BufferedWriter(fw);
        bw.write("arg0");
        bw.close();
      }catch(IOException e){
        System.out.println("文件写入失败");
      }

    }else{
      System.out.println("文件不存在");

      try{
        file.createNewFile();
      }catch(IOException e){
        System.out.println("文件创建失败");
      }
      
      
    }
  }
}